package com.itheima.controller;

import com.itheima.pojo.Login;

import com.itheima.pojo.entity.Result;
import com.itheima.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping
public class LoginController {
    @Autowired
    private LoginService loginService;
    @PostMapping("/login")
    public Result login(@RequestBody Login login) {
       Login lg = loginService.login(login);
        return Result.success(lg);
    }
}
